from django.shortcuts import render,redirect,HttpResponse
from accounts import models

def homepage(request):
    user_info = request.session.get('info')  # 使用.get()避免KeyError
    if user_info:
        user = models.RegularUser.objects.filter(username=user_info.get('username')).first()

    return render(request,'homepage.html',{"user":user})

def details(request):
    return render(request,'details.html')